package com.wc.alorithm_blue_bridge._模拟.Q4125;

import java.util.Scanner;

/**
 * @Author congege
 * @Description https://www.lanqiao.cn/problems/4125/learning/?page=1&first_category_id=1
 * @Date Created in 2023/12/9-22:59
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int len = s.length();
        StringBuffer ans = new StringBuffer();
        int cnt = 0;
        for (int i = 0; i < len; i++) {
            if (s.charAt(i) == 'Q') {
                if (cnt > 0) {
                    ans.append('L');
                    cnt = 0;
                }
                ans.append('Q');
            } else {
                cnt++;
            }
        }
        if (cnt > 0){
            ans.append('L');
        }
        System.out.println(ans);
    }
}
